<template>

  <!-- <tiny-file-upload :data="requestData" ref="uploadRef" action="" :http-request="upload">
    <template #trigger>
      <tiny-button>点击上传</tiny-button>
    </template>
</tiny-file-upload> -->
  <tiny-row>
    <tiny-button type="primary" @click="filterData">查询</tiny-button>
  </tiny-row>
  <table-test ref="votable" :data="data.tableData" @fetch-data="filterData" :msg="data.msg">

  </table-test>
</template>


<script setup>
import { reactive, ref, toRef, getCurrentInstance, onBeforeMount } from 'vue';
import { TinyFileUpload, TinyButton } from '@opentiny/vue'
const { proxy } = getCurrentInstance();
const uploadRef = ref()
const votable = ref();
const requestData = ref({
  id: 123
})
const data = reactive({
  tableData: [],
  msg: '2222',
})

const filterData = () => {
  console.log("click")
var params = {};
var page = {page:votable.value.page()};
params = Object.assign({}, params,page);
    proxy.$api.data.querySysDict(params).then(res=>{
    data.tableData=res
    })

 
}
data.tableData =  {
        "content": [
            {
                "dictId": 2,
                "dictCode": "yesOrNo",
                "dictName": "是否下拉",
                "isStop": "0",
                "dataSource": "0",
                "isTree": "0",
                "remark": "是否下拉"
            },
            {
                "dictId": 3,
                "dictCode": "sysSpaceList",
                "dictName": "显示空间字典",
                "isStop": "0",
                "dataSource": "1",
                "isTree": "0",
                "remark": "显示空间字典"
            },
            {
                "dictId": 4,
                "dictCode": "sysMenuTree",
                "dictName": "菜单下拉树",
                "isStop": "0",
                "dataSource": "1",
                "isTree": "1",
                "remark": "菜单下拉树"
            },
            {
                "dictId": 5,
                "dictCode": "rootType",
                "dictName": "请求方式",
                "isStop": "0",
                "dataSource": "0",
                "isTree": "0",
                "remark": "POST/GET"
            },
            {
                "dictId": 6,
                "dictCode": "ruleType",
                "dictName": "规则类型",
                "isStop": "0",
                "dataSource": "0",
                "isTree": "0",
                "remark": "规则类型"
            },
            {
                "dictId": 8,
                "dictCode": "cacheModel",
                "dictName": "缓存模块",
                "isStop": "0",
                "dataSource": "0",
                "isTree": "0",
                "remark": "缓存模块"
            },
            {
                "dictId": 9,
                "dictCode": "sysTable",
                "dictName": "系统表",
                "isStop": "0",
                "dataSource": "1",
                "isTree": "0",
                "remark": "系统表"
            },
            {
                "dictId": 10,
                "dictCode": "jobExcetor",
                "dictName": "任务执行器",
                "isStop": "0",
                "dataSource": "1",
                "isTree": "0",
                "remark": "任务执行器字典"
            },
            {
                "dictId": 11,
                "dictCode": "jobStatus",
                "dictName": "调度状态",
                "isStop": "0",
                "dataSource": "0",
                "isTree": "0",
                "remark": "任务调度状态"
            },
            {
                "dictId": 12,
                "dictCode": "taskAddressType",
                "dictName": "执行器地址类型",
                "isStop": "0",
                "dataSource": "0",
                "isTree": "0",
                "remark": "执行器地址类型"
            }
        ],
        "page": {
            "size": 10,
            "number": 0,
            "totalElements": 13,
            "totalPages": 2
        }
    
}
    

const action = ref('http://127.0.0.1:18765/system/file/upFile')
const upload = (param) => {


  proxy.$api.file.uploadFile(param.file).then(res => {
    data.tableData.data = res;
  });
}



</script>

<style lang="scss" scoped></style>
